using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using OVS.BusinessObjects;
using OVS.DAL;

namespace OVS.BLL
{
	public partial class UserBLL
	{
		private UserDAO _UserDAO;

		public UserDAO UserDAO
		{
			get { return _UserDAO; }
			set { _UserDAO = value; }
		}

		public UserBLL()
		{
			UserDAO = new UserDAO();
		}
		public List<User> GetUsers()
		{
			try
			{
				return UserDAO.GetUsers();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public User GetUser(int user_id)
		{
			try
			{
				return UserDAO.GetUser(user_id);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddUser(User oUser)
		{
			try
			{
				return UserDAO.AddUser(oUser);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateUser(User oUser)
		{
			try
			{
				return UserDAO.UpdateUser(oUser);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveUser(User oUser)
		{
			try
			{
				return UserDAO.RemoveUser(oUser);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveUser(int user_id)
		{
			try
			{
				return UserDAO.RemoveUser(user_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<User> DeserializeUsers(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<User>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeUsers(string Path, List<User> Users)
		{
			try
			{
				GenericXmlSerializer<List<User>>.Serialize(Users, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
